﻿<%@ Page Title="d39 grid move" Language="C#" MasterPageFile="~/d39.Master" AutoEventWireup="true" CodeBehind="GridMove.aspx.cs" Inherits="d39.GridMove" %>

<asp:Content ContentPlaceHolderID="GridPaneContent" runat="server">
    <d39:GridManipulator runat="server" id="GridManipulator" />
    <p class="note">Note: You can use the grid on the Players/Items tab to make individual characters inactive (dead/disabled) or invisible.</p>
</asp:Content>

<asp:Content ContentPlaceHolderID="ActionPaneContent" runat="server">
    <asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:CheckBox runat="server" ID="ShowMoveCompasses" AutoPostBack="true" Text="Show all player move compasses" OnCheckedChanged="ShowMoveCompasses_CheckedChanged" />
            <asp:ListView runat="server" DataSource='<%# GetPositionsToShow() %>' ItemPlaceholderID="items" ID="MoveCompasses" OnItemCommand="Move_Command">
                <LayoutTemplate><ul class="mover"><asp:PlaceHolder runat="server" ID="items" /></ul></LayoutTemplate>
                <ItemTemplate>
                    <li style='color: <%# Eval("Player.ColorString") %>; list-style: none; clear: both'>
                        <table>
                            <tr>
                                <td><asp:LinkButton runat="server" CommandName="NW">NW</asp:LinkButton></td>
                                <td><asp:LinkButton runat="server" CommandName="N">N</asp:LinkButton></td>
                                <td><asp:LinkButton runat="server" CommandName="NE">NE</asp:LinkButton></td>
                                <td rowspan="2" valign="bottom"><%# GetPosMoveString(Container.DataItem) %></td>
                            </tr>
                            <tr>
                                <td><asp:LinkButton runat="server" CommandName="W">W</asp:LinkButton></td>
                                <td><asp:Image runat="server" ImageUrl='<%# Eval("Player.ImageUrl") %>' /></td>
                                <td><asp:LinkButton runat="server" CommandName="E">E</asp:LinkButton></td>
                            </tr>
                            <tr>
                                <td><asp:LinkButton runat="server" CommandName="SW">SW</asp:LinkButton></td>
                                <td><asp:LinkButton runat="server" CommandName="S">S</asp:LinkButton></td>
                                <td><asp:LinkButton runat="server" CommandName="SE">SE</asp:LinkButton></td>
                                <td runat="server" visible='<%# (int)Eval("Moves.Count") != 0 %>' style="text-align: right">
                                    <asp:LinkButton runat="server" CommandName="undo">(Undo)</asp:LinkButton>
                                    <asp:LinkButton runat="server" CommandName="finish">(Clear)</asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </li>
                </ItemTemplate>
            </asp:ListView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
